#include<iostream>
#include<stdlib.h>

using namespace std;

int main()
{
	int max, temp;
	cin >> max;
	for (int i = max; i >= 0; i--)
	{
		cin >> temp;
		if (temp == 0) continue;
		if (temp > 0 && i != max) cout << "+";
		if (abs(temp) > 1 || i == 0) cout << temp;
		if (temp == -1 && i != 0) cout << "-";
		if (i > 1) cout << "x^" << i;
		if (i == 1) cout << "x";
	}
	return 0;
}